logistic regression cost function example